package cn.java.Concurrency.fork.test1;

import cn.java.Concurrency.fork.MyRecursiveAction;

import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;

/**
 * @author 小石潭记
 * @date 2021/12/19 20:16
 * @Description: ${todo}
 */
public class Test {
    public static void main(String[] args) throws Exception {
        MyRecursiveTask task1 = new MyRecursiveTask();
        System.out.println(task1.hashCode());
        ForkJoinPool pool = new ForkJoinPool();
        ForkJoinTask<Integer> task2 = pool.submit(task1);
        System.out.println(task2.hashCode() + " " + task2.get());
        Thread.sleep(5000);
    }
}
